-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cable: external git info #1067
base: master
Are you sure you want to change the base?
cable: external git info #1067
Conversation
e3acb28
to
9bc9833
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really have opinions here. I used git describe
years ago because it seems ideal for this job: single command gets you all information and is based on the git tags as the versioning system. Anyway, I'm not sure it is worth to maintain the cable as the external dependency, so you may consider copying to your project.
Anyway, I can merge these changes if this helps. Just please describe the changes in the CHANGELOG at the beginning of the file.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1067 +/- ##
=======================================
Coverage 94.22% 94.22%
=======================================
Files 158 158
Lines 17066 17066
=======================================
Hits 16081 16081
Misses 985 985
Flags with carried forward coverage won't be shown. Click here to find out more. |
9bc9833
to
ff46859
Compare
Problem: A git commit sha or a branch name change causes relinking of executable targets with silkworm-buildinfo library even if nothing else has changed. During development (e.g. local Debug builds) it is more important to have fast incremental builds than having the correct git commit sha and a branch name baked into the binary. Solution: Add arguments to cable_add_buildinfo_library: * GIT_DESCRIBE * GIT_BRANCH * GIT_ORIGIN_URL If passed they override corresponding git commands.
ff46859
to
a9c6b9a
Compare
@chfast yes, Who maintains Cable? Is it a 3rd-party dependency? I don't mind making it a direct dependency of silkworm, but prefer doing it as a separate change later, because I have a limited time budget for such work. I've updated the CHANGELOG ✅ |
|
Problem:
A git commit sha or a branch name change causes relinking of executable targets with silkworm-buildinfo library even if nothing else has changed.
During development (e.g. local Debug builds) it is more important to have fast incremental builds than having the correct git commit sha and a branch name baked into the binary.
Solution:
Add arguments to cable_add_buildinfo_library:
If passed they override corresponding git commands.
In Silkworm we can hardcode them in Debug builds to avoid relinking and save time when doing small changes and git rebase/squash/reword operations.
See related Silkworm PR:
erigontech/silkworm#2473
Test
Silkworm
git commit --amend --date=now && time make
output before the change:Silkworm
git commit --amend --date=now && time make
output after the change:Note
I've also tried passing GIT_COMMIT_HASH directly to buildinfo.cmake instead of via gitinfo.cmake, but it didn't help, because gitinfo.cmake is regenerating gitinfo.txt, and gitinfo.txt is set as a dependency to buildinfo.c, so even though buildinfo.c contents was not changed, it was "touched" and silkworm-buildinfo library got rebuilt.